package com.snowfield.lb47.lbconfig.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.snowfield.lb47.lbconfig.mapper.FrontProxyServerMapper;
import com.snowfield.lb47.lbconfig.domain.FrontProxyServer;
import com.snowfield.lb47.lbconfig.service.IFrontProxyServerService;

/**
 * 代理服务器Service业务层处理
 * 
 * @author snowfield
 * @date 2024-04-08
 */
@Service
public class FrontProxyServerServiceImpl implements IFrontProxyServerService 
{
    @Autowired
    private FrontProxyServerMapper frontProxyServerMapper;

    /**
     * 查询代理服务器
     * 
     * @param id 代理服务器主键
     * @return 代理服务器
     */
    @Override
    public FrontProxyServer selectFrontProxyServerById(Long id)
    {
        return frontProxyServerMapper.selectFrontProxyServerById(id);
    }

    /**
     * 查询代理服务器列表
     * 
     * @param frontProxyServer 代理服务器
     * @return 代理服务器
     */
    @Override
    public List<FrontProxyServer> selectFrontProxyServerList(FrontProxyServer frontProxyServer)
    {
        return frontProxyServerMapper.selectFrontProxyServerList(frontProxyServer);
    }

    /**
     * 新增代理服务器
     * 
     * @param frontProxyServer 代理服务器
     * @return 结果
     */
    @Override
    public int insertFrontProxyServer(FrontProxyServer frontProxyServer)
    {
        frontProxyServer.setCreateTime(DateUtils.getNowDate());
        return frontProxyServerMapper.insertFrontProxyServer(frontProxyServer);
    }

    /**
     * 修改代理服务器
     * 
     * @param frontProxyServer 代理服务器
     * @return 结果
     */
    @Override
    public int updateFrontProxyServer(FrontProxyServer frontProxyServer)
    {
        frontProxyServer.setUpdateTime(DateUtils.getNowDate());
        return frontProxyServerMapper.updateFrontProxyServer(frontProxyServer);
    }

    /**
     * 批量删除代理服务器
     * 
     * @param ids 需要删除的代理服务器主键
     * @return 结果
     */
    @Override
    public int deleteFrontProxyServerByIds(Long[] ids)
    {
        return frontProxyServerMapper.deleteFrontProxyServerByIds(ids);
    }

    /**
     * 删除代理服务器信息
     * 
     * @param id 代理服务器主键
     * @return 结果
     */
    @Override
    public int deleteFrontProxyServerById(Long id)
    {
        return frontProxyServerMapper.deleteFrontProxyServerById(id);
    }
}
